{extend name='admin@main'}

{block name="content"}
<form class="layui-form layui-card" onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post"
      autocomplete="off">
    <div class="layui-card-body">
        <input type="hidden" name="activity_id" value="{$_GET['activity_id']}">
        {foreach name="product" item="vo" key="key"}
        {if condition="in_array($key, $hasProduct)"}
        <input type="checkbox" name="productId[]" title="{$vo}" lay-skin="primary" value="{$key}" checked>&nbsp;&nbsp;&nbsp;&nbsp;
        {else /}
        <input type="checkbox" name="productId[]" title="{$vo}" lay-skin="primary" value="{$key}">&nbsp;&nbsp;&nbsp;
        {/if}
        {/foreach}
    </div>
    <div class="hr-line-dashed"></div>
    <div class="layui-form-item text-center">
        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
</form>
{/block}
{block name='script'}
<script>
    window.form.render();
</script>
{/block}